package com.forage.exp.controller;

import com.forage.exp.constant.ResponseStatusEnum;
import com.forage.exp.po.Response;
import com.forage.exp.service.KindService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.iceclean.logtrace.annotation.EnableLogTrace;
import top.iceclean.logtrace.bean.Logger;

/**
 * @author : Ice'Clean
 * @date : 2022-05-12
 */
@RestController
@RequestMapping("kind")
@EnableLogTrace
public class KindController {

    @Autowired
    private KindService kindService;

    private Logger logTrace;

    @GetMapping("/all")
    public Object getAllKinds() {
        return new Response()
                .setStatus(ResponseStatusEnum.OK)
                .addData("kindList", kindService.getAllKinds());
    }
}
